﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace JXT.PrimaryKey.Batman.Core.Configuration
{
    /// <summary>
    /// 服务数据库连接配置节点
    /// </summary>
    public class ServiceConnectionSettingConfigurationElement : ConfigurationElement
    {
        public ServiceConnectionSettingConfigurationElement()
        {
        }

        /// <summary>
        /// 数据库配置名称
        /// </summary>
        [ConfigurationProperty("name", IsRequired = true, IsKey = true)]
        public string Name
        {
            get { return this["name"] as string; }
            set { this["name"] = value; }
        }

        /// <summary>
        /// 连接字符串
        /// </summary>
        [ConfigurationProperty("connectionString", IsRequired = true)]
        public string ConnectionString
        {
            get { return this["connectionString"] as string; }
            set { this["connectionString"] = value; }
        }

        /// <summary>
        /// 数据库(可选)
        /// </summary>
        [ConfigurationProperty("database", IsRequired = false)]
        public string Database
        {
            get { return this["database"] as string; }
            set { this["database"] = value; }
        }
    }
}
